using System;
using System.Diagnostics.Contracts;

namespace OpenWaves
{
    [AttributeUsage(AttributeTargets.Field)]
    public sealed class DisplayTextAttribute : Attribute, IDisplayTextProvider
    {
        private readonly string displayText;


        /// <summary>
        /// Instantiates the DisplayTextAttribute object
        /// </summary>
        /// <param name="displayText">Description of the enum value</param>
        public DisplayTextAttribute(string displayText)
        {
            Contract.Requires<ArgumentNullException>(displayText != null);
            this.displayText = displayText;
        }

        /// <summary>
        /// Text describing the enum value
        /// </summary>
        public string DisplayText
        {
            get { return this.displayText; }
        }
    }
}